/**
 * Created by thomas on 2018/2/17.
 */

const Common_ajax = {};
Common_ajax.install = function (Vue, options) {
  // 3. 注入组件
  Vue.mixin({
    methods: {
      $tajax: function (opt = {m: "post", url: "", data: {}}) {
            return axios({
              method: opt.m,
              url: opt.url,
              data: opt.data
            })
      },
      get_user_id:function(){
        return location.search.split("user_id=")[1];
      },
      get_user_msg:function () {
        return JSON.parse(localStorage.getItem("user_loc_mes"));
      }
    }
  })
}

module.exports = Common_ajax;

